<?php 
set_time_limit(0);
ini_set("memory_limit", "12M");
if(!isset($_SESSION)) 
{ 
session_start(); 
} 

if (isset($_SESSION['s_alarm']) and is_array($_SESSION['s_alarm']) and isset($_REQUEST['pageNum']) and isset($_REQUEST['rows_per_page']) and isset($_REQUEST['number_of_page'])) {
	
	$pageNum = $_REQUEST['pageNum'];
	$rows_per_page = $_REQUEST['rows_per_page'];
	$pageend = $pageNum*$rows_per_page;
	$pagestart = $pageend - $rows_per_page;
	$index = 0;
	$real=0;
	$mylist = $_SESSION['s_alarm'];
	
	foreach ($mylist as $key =>$row){
		$index+=1;
		
		//array_push($mylist, array($row[carnumber],$row[code1],$row[cartype],$row[code2]));
		if ($index<=$pagestart) {
			continue;
		}elseif ($index > $pageend){
			break;
		}
		else{$real++;
	?>
		 <tr>
		 	<td width="10%" align="center"><?=$index?></td>
		 	 <td  width="30%"><?=$row[0]?></td>
		 	 <td  width="20%"><?=$row[1]?></td>
		 	 <td  width="20%"><?=$row[2]?></td>
		 	 <td   class="last"><?=$row[3]?></td>
		 </tr> 
						 
	<?php  
		}
	}
	if ($real>0 and $real<17) {
			 	foreach(range(0,17-$real) as $i){
			 		?>
			 		<tr>
			 		<td width="10%">&nbsp;</td>
				 	<td width="30%">&nbsp;</td>
				 	<td width="20%">&nbsp;</td>
				 	<td width="20%">&nbsp;</td>
				 	<td  class="last">&nbsp;</td>
				 	</tr>
			 	<?php }
	}
	
	
}
?>  